<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
		<link rel="stylesheet" type="text/css" href="" />
		<title>后台管理登录</title>
		<link rel="icon" href="img/lei_huiyuan_on.png"  size="16x16" />
		<link rel="stylesheet" type="text/css" href="css/to.css"/>
		<link rel="stylesheet" type="text/css" href="css/admin.css?v=1.0.1"/>
	</head>
	<style type="text/css">
		html,body{height: 100%;}
	</style>
	<body>
		<div class="denglu">
			<div class="zhanhao">
				<p class="denglu_txt bai_30">积分后台管理</p>
				<input type="text" name="" id="" value="" placeholder="账号" class="shouji" />
				<input type="text" name="" id="" value="" placeholder="密码" class="mima" />
				<div class="denglu_anniu bai_18">
					登录
				</div>
				
			</div>
		</div>

		<script src="js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="layer/layer.js" type="text/javascript" charset="utf-8"></script>
<script src="js/fengzhuang.js?v=1.0.2"></script>

		<script type="text/javascript">
			$('.denglu_anniu').click(function() {

				var zhanghao = $('.shouji').val()
				var mima = $('.mima').val()

				if (!zhanghao) {
					layer.msg('请输入账号')
					return false;
				}
				if (!mima) {
					layer.msg('请输入密码')
					return false;
				}
				
				
				
				$.ajaxDirect("/api/adminLogin",'post',{
					'username':zhanghao,
					'password':mima
				},
				 function (data) {
					 if(data.code==200){
						 localStorage.setItem('token',data.token);
						 localStorage.setItem('user_name',data.user.username);
						 layer.msg('登录成功')
						 location.href='order_list.html'
					 }
						
				        //发送成功
				},
				function (data) {
				        //发送失败
				}
				)
				
			})
		</script>


	</body>
</html>
